import App from './App'
import messages from './locale/index'

let i18nConfig = {
	locale: uni.getLocale(),
	messages
}

console.log('i18nConfig==', i18nConfig);


// #ifndef VUE3
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import './uni.promisify.adaptor'
import config from 'common/config.js'
import store from 'store/index.js'
import common from 'common/common.js'
import {
	router,
	RouterMount
} from '@/common/utils/router'

Vue.use(VueI18n)
const i18n = new VueI18n(i18nConfig)
Vue.use(router)
Vue.prototype.config = config
Vue.prototype.common = common
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	i18n,
	...App,
	store
})

//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, '#app')
// #endif

// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif


// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import uView from 'uview-ui'
import {
	createI18n
} from 'vue-i18n'
const i18n = createI18n(i18nConfig)
export function createApp() {
	const app = createSSRApp(App)
	app.use(uView)
	app.use(i18n)
	return {
		app
	}
}
// #endif